#ifndef __BUOLA_SCENE_CINDEXDATA_H__
#define __BUOLA_SCENE_CINDEXDATA_H__

#include <buola/scene.h>
#include <buola/gl.h>

namespace buola { namespace scene {

class CIndexData
{
public:
    CIndexData();
    ~CIndexData();

public:
    int GetIndexSize()     {   return mIndexSize;     }
    int GetIndexCount()    {   return mIndexCount;    }

    void Resize(int pCount);

    uint32_t *Map(GLenum pType=GL_WRITE_ONLY);
    void Unmap();

    GLuint GetIBO() {   return mIBO;    }

    GLuint GetPrimitiveRestartIndex()   {   return mRestartIndex;   }
    void SetPrimitiveRestartIndex(GLuint pIndex);

private:
    GLuint mIBO;
    int mIndexSize;
    int mIndexCount;
    GLuint mRestartIndex;
};

/*namespace scene*/ } /*namespace buola*/ }

#endif
